About Cosense
Help
Log in
未来の自分を助けるメモ
J
e
s
t
s
n
a
p
s
h
o
t
-
t
e
s
t
i
n
g
#
J
e
s
t
e
x
p
e
c
t
(
o
u
t
p
u
t
)
.
t
o
M
a
t
c
h
S
n
a
p
s
h
o
t
(
)
で
、
o
u
t
p
u
t
に
変
化
が
な
い
か
ど
う
か
を
テ
ス
ト
で
き
る
。
o
u
t
p
u
t
を
意
図
し
て
変
更
し
た
場
合
は
j
e
s
t
-
-
u
p
d
a
t
e
S
n
a
p
s
h
o
t
j
e
s
t
-
u
p
a
c
k
a
g
e
.
j
s
o
n
に
書
く
場
合
に
は
、
s
c
r
i
p
t
s
フ
ィ
ー
ル
ド
に
、
n
p
m
t
e
s
t
-
-
-
u
-
u
で
、
s
n
a
p
s
h
o
t
を
u
p
d
a
t
e
n
p
m
で
、
s
c
r
i
p
t
s
に
コ
マ
ン
ド
を
設
定
し
て
る
場
合
に
、
オ
プ
シ
ョ
ン
を
渡
す
に
は
、
-
-
の
あ
と
に
渡
せ
ば
よ
い
よ
う
.
参
考
:
ス
ナ
ッ
プ
シ
ョ
ッ
ト
テ
ス
ト
·
J
e
s
t
J
e
s
t
の
S
n
a
p
s
h
o
t
テ
ス
ト
に
感
動
し
た
話
-
A
k
i
f
u
m
i
S
a
t
o
p
o
r
t
f
o
l
i
o
I
n
t
r
o
d
u
c
t
i
o
n
t
o
J
e
s
t
S
n
a
p
s
h
o
t
T
e
s
t
i
n
g
i
n
V
u
e
.
j
s
|
D
i
g
i
t
a
l
O
c
e
a
n
Related
Sort by
Related
Modified
Created
Last visited
Most linked
Page rank
Title
Links
Jest
jsdomを利用して ブラウザに近い動きのテストができる。mockspyassert[Jest snapshot-testing]
package.json
#npm[【初心者向け】NPMとpackage.jsonを概念的に理解する - Qiita https://qiita.com/righteous/items/e5448cb2e7e11ab7d477]name, version, private...okmain: packageとして外部に公開する場合に、entryポイントになる。通常は必要ない。[package.json scripts]
Jest
vue.js test
#jest[vue3]対応のものをやらないといけないが、、[Vue.jsテストハンドブック | Vueテストハンドブック https://lmiller1990.github.io/vue-testing-handbook/ja/]日本語のが理解しやすいので日本語で読んで、でも、英文のがupToDateなので、そちらを参照する。componentのrender. ok
vuex-smart-module
#Vue.js_TypeScript[ktsn/vuex-smart-module: Type safe Vuex module with powerful module features https://github.com/ktsn/vuex-smart-module]ReadMeが読みやすい、感じがする[Vuex × TypeScriptにvuex-smart-moduleを選んだ理由 - Qiita https://qiita.com/92thunder/items/1afe1ee67dcf4d693faf]
Vue.js config
プラグインを入れる度に設定ファイルが増えていく?ので、整理したい。で、環境を出力してみておく。頭の整理に使う。(git, python関連除く).env.eslintrc.js: [ESLint]
Javascript Test
[Local Development with the Firebase Emulator Suite https://codelabs.developers.google.com/firebase-emulator]この codelabをやってる。[Firestore Security Rules]は、test必須ぽいので、やる。mocha --timeout 5000 --exit が、pacakge.jsonに記述されてる。
package.json
バージョン制約
[Semantic versioning] #version #制約Major, Minor, Patch> >バージョン番号を「メジャー.マイナー.パッチ」という形式で表記します。 by ChatGPT`^` キャレットは、Majorの一致`~`チルダは、Minorの一致
dependencies package.json
package.json firebase-functions
https://github.com/firebase/firebase-functions/issues/587 > Typescript compilation error: Argument of type 'Express' is not assignable `[..]` · Issue `#587` · firebase/firebase-functionslatestの 3.13でも解消されてない。
Created
5 years ago
by
kimiyuki shirai
Updated
5 years ago
by
kimiyuki shirai
Views: 31
Page rank: 3
Copy link
Copy readable link
Start presentation
Hide dots
Jest snapshot-testing
#Jest
expect( output ).toMatchSnapshot()
で、outputに変化がないかどうかをテストできる。
outputを意図して変更した場合は
jest --updateSnapshot
jest -u
package.json
に書く場合には、scriptsフィールドに、
npm test -- -u
-u
で、snapshotをupdate
npmで、scriptsに コマンドを設定してる場合に、オプションを渡すには、
--
のあとに渡せばよいよう.
参考:
スナップショットテスト · Jest
JestのSnapshotテストに感動した話 - Akifumi Sato portfolio
Introduction to Jest Snapshot Testing in Vue.js | DigitalOcean